package com.project.mapper;

import com.project.bean.UserBean;
import org.apache.ibatis.annotations.*;

@Mapper
public interface IUserMapper {
    /**
     * 登录
     * @param userName 用户名
     * @param pwd 密码
     * @return 用户对象
     */
    @Select("select * from t_user3 where u_name=#{name} and u_pwd=#{pwd}")
    @ResultMap("userMap")
    public UserBean login(@Param("name") String userName, @Param("pwd") String pwd);

    /**
     * 添加用户
     * @param user 用户对象
     */
    @Insert("INSERT INTO t_user3(u_name,u_pwd,u_email,u_face,u_date)\n" +
            "VALUES(#{name},#{pwd},#{email},#{image},#{registerDate})")
    public void add(UserBean user);
}
